#include <cstdio>

int a[ 7 ], sum;
bool f[ 120010 ], g[ 120010 ], yes;

void work( )
{
    int i, j, k, high, low, count;
    low = a[ 1 ] + a[ 2 ] * 2 + a[ 3 ] * 3;
    for ( i = 0; i <= low; i++ )
        f[ i ] = false;
    for ( i = 0; i <= a[ 1 ]; i++ )
        f[ i ] = true;
    for ( i = 2; i <= 3; i++ )
        for ( j = low; j >= 0; j-- )
            if ( f[ j ] )
            {
                k = j + i;
                count = 1;
                while ( ( !f[ k ] ) && count++ <= a[ i ] )
                {
                    f[ k ] = true;
                    k += i;
                }
            }
    high = a[ 4 ] * 4 + a[ 5 ] * 5 + a[ 6 ] * 6;
    for ( i = 0; i <= high; i++ )
        g[ i ] = false;
    for ( i = 0; i <= a[ 6 ]; i++ )
        g[ i * 6 ] = true;
    for ( i = 5; i >= 4; i-- )
        for ( j = high; j >= 0; j-- )
            if ( g[ j ] )
            {
                k = j + i;
                count = 1;
                while ( ( !g[ k ] ) && count++ <= a[ i ] )
                {
                    g[ k ] = true;
                    k += i;
                }
            }
    for ( i = 0; i <= low; i++ )
        if ( f[ i ] && g[ sum / 2 - i ] )
        {
            yes = true;
            printf("Can be divided.\n\n");
            return ;
        }
}

int main( )
{
    int i, t = 1;
    while ( 1 )
    {
        yes = sum = 0;
        for ( i = 1; i <= 6; i++ )
        {
            scanf("%d", &a[ i ]);
            sum += a[ i ] * i;
        }
        if ( !sum )
            break;
        printf("Collection #%d:\n", t++);
        if ( sum & 1 )
            printf("Can't be divided.\n\n");
        else
        {
            work( );
            if ( !yes )
                printf("Can't be divided.\n\n");
        }
    }
    return 0;
}
